package com.hong.spring.sepl;

import com.alibaba.fastjson.JSON;
import com.hong.spring.common.entity.SpElUser;
import com.hong.spring.common.entity.SpElUser2;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Auther: csh
 * @Date: 2020/7/13 18:30
 * @Description:实现xml与注解
 */
public class SpringSpEl {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spel/applicationfile-spel.xml");
        SpElUser bean = applicationContext.getBean(SpElUser.class);
        System.out.println(bean.getAge());
        SpElUser2 spelUser2 = applicationContext.getBean("spElUser2",SpElUser2.class);
        System.out.println(JSON.toJSONString(spelUser2));

    }
}
